package com.qding.park.manager.app.queue.handle;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.alibaba.fastjson.JSONObject;
import com.qding.park.common.core.exceptions.BaseException;
import com.qding.park.common.core.redis.SerializeUtils;
import com.qding.park.manager.facade.queue.service.ReportFacade;
import com.qding.park.manager.pojo.ap.ApCarLockAlarm;
import com.qding.park.manager.pojo.queue.QueueMsg;

/**
  * @ClassName: ReserveDelayTimeoutHandle
  * @Description: 锁车出场报警
  * @author Comsys-Administrator
  * @date 2016年10月20日 上午10:10:31
  *
  */
@Component("carlockOutalarmHandle")
public class CarlockOutalarmHandle extends AbstractReportHandle{
	/**
	 * @Field @inviteFacade : TODO(邀请单核心业务)
	 */
	@Autowired
	private ReportFacade  reportFacade;
	

	@Override
	void actualHandle(QueueMsg msg) throws BaseException {
		JSONObject data = (JSONObject) msg.getData();
		ApCarLockAlarm apCarLockAlarm=SerializeUtils.unSerialize(data.toJSONString(), ApCarLockAlarm.class);
		reportFacade.alarmCockCar(apCarLockAlarm);
	}


	@Override
	boolean failDiscardRollBacK(QueueMsg msg) {
		_log.error("车场进场消息回滚:"+msg);
		return true;
	}
}
